﻿#ifndef RECEIVER_H
#define RECEIVER_H

#include <iostream>

#include <thread>
#include <boost/asio.hpp>

using namespace boost;

class Receiver {

public:
	Receiver(asio::io_context& context, const asio::ip::address& listen_addr, const asio::ip::address& multicast_addr);

private:
	void do_recv();

private:
	static constexpr size_t BUFF_SIZE = 1024;

private:
	int multicast_port_ = 30004;
	std::array<char, BUFF_SIZE>buff_;
	boost::asio::ip::udp::endpoint endpoint_;
	boost::asio::ip::udp::socket socket_;

};

#endif //RECEIVER_H
